package com.ald.crossex.dto;

import com.alibaba.fastjson.JSON;

/**
 * Created by lishijiong on 15/1/29.
 */
public class JqGridRequest extends BaseRequest {

    public static String JQGRIDREQUEST_OPER_ADD = "add";
    public static String JQGRIDREQUEST_OPER_EDIT = "edit";
    public static String JQGRIDREQUEST_OPER_DEL = "del";


    /**
     * 表示请求页码的参数名称
     * "page"
     */
    private Integer page;


    /**
     * 表示请求行数的参数名称
     * "rows"
     */
    private Integer rows;


    /**
     * 表示用于排序的列名的参数名称
     * "sidx"
     */
    private String sidx;

    /**
     * 表示采用的排序方式的参数名称
     * "sord"
     */
    private String sord;

    /**
     * 表示是否是搜索请求的参数名称
     * "_search"
     */
    private boolean search;


    /**
     * 表示已经发送请求的次数的参数名称
     * "nd"
     */
    private String nd;

    /**
     * 表示当在编辑数据模块中发送数据时，使用的id的名称
     * "id"
     */
    private String id;

    /**
     * operation参数名称
     * "oper"
     * 当在edit模式中提交数据时，操作的名称
     * "edit"
     * 当在add模式中提交数据时，操作的名称
     * "add"
     * 当在delete模式中提交数据时，操作的名称
     * "del"
     */
    private String oper;

    /**
     * 当点击以载入数据到子表时，传递的数据名称
     * "id"
     */
    private String subgridid;

    /**
     * 选择节点id
     */
    private String nodeid;

    /**
     *
     */
    private String npage;

    /**
     * 表示需从Server得到总共多少行数据的参数名称，参见jqGrid选项中的rowTotal
     * "totalrows"
     */
    private Integer totalrows;

    /**
     * 查询过滤条件
     */
    private JqGridFilter oFilters;
    private String filters;


    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public String getSidx() {
        return sidx;
    }

    public void setSidx(String sidx) {
        this.sidx = sidx;
    }

    public String getSord() {
        return sord;
    }

    public void setSord(String sord) {
        this.sord = sord;
    }

    public boolean isSearch() {
        return search;
    }

    public void setSearch(boolean search) {
        this.search = search;
    }

    public String getNd() {
        return nd;
    }

    public void setNd(String nd) {
        this.nd = nd;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOper() {
        return oper;
    }

    public void setOper(String oper) {
        this.oper = oper;
    }

    public String getNodeid() {
        return nodeid;
    }

    public void setNodeid(String nodeid) {
        this.nodeid = nodeid;
    }

    public String getSubgridid() {
        return subgridid;
    }

    public void setSubgridid(String subgridid) {
        this.subgridid = subgridid;
    }

    public String getNpage() {
        return npage;
    }

    public void setNpage(String npage) {
        this.npage = npage;
    }

    public Integer getTotalrows() {
        return totalrows;
    }

    public void setTotalrows(Integer totalrows) {
        this.totalrows = totalrows;
    }

    public JqGridFilter getoFilters() {
        return JSON.parseObject(filters, JqGridFilter.class);
    }

    public void setoFilters(JqGridFilter oFilters) {
        this.oFilters = oFilters;
    }

    public String getFilters() {
        return filters;
    }

    public void setFilters(String filters) {
        this.filters = filters;
    }
}
